/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Trabalho3.RegrasPasswordChecker02;

import Trabalho3.RuleFactory;

/**
 *
 * @author geraldo
 */
public class RegraBonusSimbolos implements RuleFactory{
    private final int FATOR_BONUS_SIMBOLOS = 6;
    String password;
 
    public RegraBonusSimbolos(String password) {
        this.password = password;
    }
    
    @Override
    public int calcularRegra() {
         int total = new Somatorios(password).somarSimbolos();
        return (total<=password.length() && total>0)? total* FATOR_BONUS_SIMBOLOS:0;
    }
}
